package teacher.service.impl;

import teacher.dao.TeacherDao;
import teacher.entity.Teacher;
import teacher.service.TeachertService;

import java.util.Scanner;

public class TeachertServiceImpl implements TeachertService {
    private String studentId;

    @Override
    public void teachercMenu() {
        while (true) {
            System.out.println("****************************************");
            System.out.println("      欢迎使用仁爱学院教务管理系统（教师端）");
            System.out.println("            1.教师个人信息");
            System.out.println("            2.教师课表");
            System.out.println("            3.学生成绩管理");
            System.out.println("            4.教师修改学生信息");
            System.out.println("            5.退出");
            System.out.println("****************************************");
            System.out.print("请输入你的选择：");
            Scanner scanner = new Scanner(System.in);
            String next = scanner.next();
            switch (next) {
                case "1":
                    teachercRevise();
                    break;
                case "2":
                    teachercp();
                    break;
                case "3":
                    teachercStudent();
                    break;
                case "4":
                    teachercs();
                    break;
                case "5":
                    return;
                default:
            }
        }
    }

    @Override
    public void teachercp() {
        new TeacherDao().teachercp();
    }

    @Override
    public void teachercStudent() {
        new TeacherDao().teachercStudent();
    }

    @Override
    public void teachercRevise() {
        new TeacherDao().teachercRevise();
    }

    @Override
    public void teachercs() {
        System.out.println("-------教师修改学生信息-------------");
        Scanner scanner = new Scanner(System.in);
        Teacher teacher = new Teacher();
        String studentId = scanner.next();
        teacher.setStudentId(studentId);
        System.out.println("请输入登录账号：");
        String teacherLoginName = scanner.next();
        teacher.setTeacherLoginName(teacherLoginName);
        System.out.println("请输入登录密码：");
        String teacherLoginPassword = scanner.next();
        teacher.setTeacherLoginPassword(teacherLoginPassword);
        System.out.println("请输入学生姓名：");
        String studentName = scanner.next();
        teacher.setStudentName(studentName);
        System.out.println("请输入学生成绩：");
        String studentCj = scanner.next();
        teacher.setStudentCj(studentCj);
        new TeacherDao().teachercs(teacher);
    }


}



